#ifndef POS_H
#define POS_H

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

/** Device descriptor. */
typedef void * POS_HANDLE;
extern const POS_HANDLE POS_NONE;


/** Available actions. */
extern const int ACTION_BREAK;
extern const int ACTION_TEST;
extern const int ACTION_CASH;
extern const int ACTION_DEPOSIT;
extern const int ACTION_PAYMENT;
extern const int ACTION_RETURN;
extern const int ACTION_PREAUTH;
extern const int ACTION_COMPLETE;
extern const int ACTION_REVERSAL;
extern const int ACTION_BALANCE;
extern const int ACTION_CLOSE_DAY;

/** Available responses. */
extern const int RESP_TIMEOUT;
extern const int RESP_BREAK;
extern const int RESP_CONFIRM;
extern const int RESP_DECLINE;
extern const int RESP_MESSAGE;
extern const int RESP_INPUT;

/** Available parameters. */
extern const char *POS_AMOUNT;
extern const char *POS_CURRENCY;
extern const char *POS_PROFILE;
extern const char *POS_TRANS_ID;
extern const char *POS_TRANS_CODE;
extern const char *POS_TRANS_APPROVAL;
extern const char *POS_TRANS_STATUS;
extern const char *POS_TRANS_ACTION;
extern const char *POS_TRANS_MSGCODE;
extern const char *POS_DATE_TIME;
extern const char *POS_CARD_PAN;
extern const char *POS_CARD_EXPIRY;
extern const char *POS_CARD_HOLDER;
extern const char *POS_MSG_TITLE;
extern const char *POS_MSG_BODY;
extern const char *POS_MSG_BREAK;
extern const char *POS_PRINT;

/** Available methods. */
extern bool pos_open(POS_HANDLE *handle_p, const char *name);
extern bool pos_close(POS_HANDLE *handle_p);

extern bool pos_send(POS_HANDLE handle, int action);
extern int pos_receive(POS_HANDLE handle, int timeout);

extern bool pos_set(POS_HANDLE handle, const char *param, const char *val);
extern bool pos_get(POS_HANDLE handle, const char *param, char *val, int val_size);

extern bool pos_get_first(POS_HANDLE handle, char *param, int param_size, char *val, int val_size);
extern bool pos_get_next(POS_HANDLE handle, char *param, int param_size, char *val, int val_size);


#ifdef __cplusplus
}; /* extern "C" */
#endif /* __cplusplus */

#endif /* POS_H */
